import { request } from "@/http/axios";
import type * as Models from "./type";

/**
 * 上传文件
 * config.headers["Content-Type"] = "multipart/form-data"
 * @param data
 * @returns
 */
export function upload(data: FormData) {
  return request<HttpResponseResult<Models.ResourceResult>>({
    url: "/api/file/upload",
    method: "post",
    data
  })
}

/**
 * Base64文件上传
 * config.headers["Content-Type"] = "application/json"
 * @param data
 * @returns
 */

export function uploadBase64(data: Models.ResourceParam) {
  return request<HttpResponseResult<Models.ResourceResult>>({
    url: "/api/file/uploadBase64",
    method: "post",
    data
  })
}
